// app.js (在服务器和客户端之间共享)
import { createSSRApp } from "vue";

export function createApp() {
  // 返回一个 ssr 的应用实例
  return createSSRApp({
    data: () => ({ count: 1 }),
    template: `<button @click="count++">{{ count }}</button>`,
  });
}

export function createAbout() {
  // 返回一个 ssr 的应用实例
  return createSSRApp({
    data() {
      return {
        msg: "张三",
      };
    },
    template: `
      <div>
        <h1>About - {{ msg }}</h1>

        <input v-model="msg" />
      </div>
    `,
    created() {
      // console.log(window);
      console.log("About created");
    },

    mounted() {
      console.log("About mounted");
    },
  });
}
